#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
	const int LENGTH = 101;
	char s[LENGTH];
	char **arr = new char*[LENGTH - 1];
	int idx = 0;
	memset(s, 0, LENGTH);
	cin >> s;
	while (s[0] != '0' || strlen(s) != 1 ) {
		char *row = new char[LENGTH];
		memset(row, '0', LENGTH - 1);
		row[LENGTH - 1] = '\0';
		for (int i = LENGTH - 2, j = strlen(s) - 1; i >= 0 && j >= 0; i--, j--)
		{
			row[i] = s[j];
		}

		arr[idx++] = row;
		cin >> s;
	}
	char result[LENGTH + 2];
	int resultIdx = 0;
	memset(result, 0, LENGTH + 2);
	int tens = 0;
	int i, j;
	for (i = LENGTH - 2; i >= 0; i-- ) {
		int sum = 0;
		for (j = 0; j < idx; j++) {
			sum += (arr[j][i] - '0');
		}
		sum += tens;
		tens = sum / 10;
		char units = sum % 10 + '0';
		result[resultIdx++] = units;

		if (i == 0 && tens != 0) {
			char units = tens % 10 + '0';
			result[resultIdx++] = units;
			if (tens / 10 != 0) {
				units = tens / 10 + '0';
				result[resultIdx++] = units;
			}
		}
	}
	for (i = 0; i < idx; i++) {
		delete arr[i];
	}
	delete []arr;
	bool firstNotZero = false;
	for (i = resultIdx - 1;i >= 0; i--) {
		if (result[i] != '0') {
			firstNotZero = true;
			cout<<result[i];
		} else if (firstNotZero) {
			cout<<result[i];
		}
	}
	cout<<endl;
	return 0;
}